package com.example.wwj.service;

import com.example.wwj.mapper.ScoreMapper;
import com.example.wwj.pojo.Curriculum;
import com.example.wwj.pojo.Score;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class ScoreService {
    @Autowired
    private ScoreMapper scoreMapper;

    public List<Score> scoreList(){
        return scoreMapper.findAll();
    }

    public List<Score> selectPage(Integer pageNum, Integer pageSize, Integer class_id, Integer grade_id, String teacher_name,String student_name) {
        return scoreMapper.selectPage(pageNum,pageSize,class_id,grade_id,teacher_name,student_name);
    }

    public Integer selectTotal(Integer class_id,Integer grade_id,String teacher_name,String student_name) {
        return scoreMapper.selectTotal(class_id,grade_id,teacher_name,student_name);
    }

    public int deleteById(List<Integer> ids){
        Map<String, Object> map = new HashMap<>();
        map.put("ids", ids);
        return scoreMapper.deleteScoreByIds(map);
    }

}
